package com.xw.childhealth.service.impl;

import com.xw.childhealth.dao.DataDictionaryDao;
import com.xw.childhealth.entity.DataDictionary;
import com.xw.childhealth.service.DataDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author: y
 * @CreateDate: 2019-11-07 16:36
 * @Version: 1.0
 */
@Service
public class DataDictionaryImpl implements DataDictionaryService {

    @Autowired
    private DataDictionaryDao dictionaryDao;

    @Override
    public List<DataDictionary> findParentNode(Integer id) {
        return dictionaryDao.findByParentIdEquals(id);
    }

    @Override
    public DataDictionary findOneById(Integer id) {
        return dictionaryDao.findByIdEquals(id);
    }

    @Override
    public DataDictionary save(DataDictionary data) {
        return dictionaryDao.save(data);
    }

    @Override
    public void delRecord(Integer id) {
        dictionaryDao.deleteById(id);
    }


}
